#!/bin/bash

echo "set title \"Performance vs tree depth\"
set logscale
set key right bottom
set xlabel \"Tree depth\"
set ylabel \"Runtime\"
set output \"tree-performance.png\"
set terminal png
plot \"-\" using 1:4 notitle
"

COUNT=100
until [ $COUNT -gt 5000 ]; do
	echo -n "$COUNT+1 "
	./tree -n $COUNT | tail -n-1 | awk '{ print $3, $5, $7}'
	let COUNT=COUNT+100
done 
echo "end"
